package com.example.demo.study.thread.threadLocalTry.no;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.logging.SimpleFormatter;

public class Case1DateParse {
    //线程不安全
    public static final   SimpleDateFormat sf=new SimpleDateFormat("yyyy-MM-dd");
    public static void main(String[] args) {
        //会报错
        for(int i=0;i<10;i++)
        {
            new Thread(()->{
                try {
                    System.out.println(sf.parse("2024-07-12"));
                } catch (ParseException e) {
                    e.printStackTrace();
                }
            }).start();
        }
    }

}
